package ProjectoX;

import java.util.Timer; 
import java.util.TimerTask;

public class Reminder {
	Timer timer;
	Nivel N;
	Enemigo E;
	Componente C;
	Mario M;
	
    public Reminder (int seconds, Enemigo e )   {  
        timer = new Timer() ;
        E = e;
        timer.schedule(new RemindTaskE(), seconds*100); 
     } 
    
    public Reminder (int seconds, Nivel n )   {  
        timer = new Timer() ;
        N = n;
        timer.schedule(new RemindTaskN(), seconds*100); 
     } 

    public Reminder (int seconds, Componente c )   {  
        timer = new Timer() ;
        C = c;
        timer.schedule(new RemindTaskC(), seconds*100); 
     }
    
    public Reminder (int seconds, Mario m )   {  
        timer = new Timer() ;
        M = m;
        timer.schedule(new RemindTaskM(), seconds*100); 
     }
    
class RemindTaskE extends TimerTask  {  
    public void run (  )   {  
        E.puedeatacar();
        timer.cancel (  ) ; //Terminate the timer thread 
     }  
 }

class RemindTaskC extends TimerTask  {  
    public void run (  )   {  
        C.puedeAccionar();
        timer.cancel (  ) ; //Terminate the timer thread 
     }  
 }

class RemindTaskM extends TimerTask  {  
    public void run (  )   {  
        M.setVencible();
        timer.cancel (  ) ; //Terminate the timer thread 
     }  
 }

class RemindTaskN extends TimerTask  {  
    public void run (  )   {  
        N.gameWiner();
        timer.cancel (  ) ; //Terminate the timer thread 
     }  
 }

}
